import {sniff,setupWebViewJavascriptBridge} from "commonUtils"

export function scanCode(datas,callback) {
    if(sniff().ios) {
		setupWebViewJavascriptBridge(function(bridge) {
			bridge.callHandler('scanCode',{},function(response) {
				if(callback && typeof callback == 'function') {
					callback.apply(null, arguments);
				}
			})
		})
	}
	if(sniff().android) {
		AndroidApi.scanCode({},function(response){
			if(callback && typeof callback == 'function') {
				callback.apply(null, arguments);
			}
		});
	}
}

